<% layout('boilerplate') -%>
<link rel="stylesheet" href="<%= linkPath %>/css/index.css" />
<link rel="stylesheet" href="<%= linkPath %>/css/test.css" />
<link rel="stylesheet" href="<%= linkPath %>/css/style.css" />
<link rel="stylesheet" href="<%= linkPath %>/css/example.css" />
<link rel="stylesheet" href="<%= linkPath %>/css/responsive.css" />
<link rel="stylesheet" href="<%= linkPath %>/css/exampleresponsive.css" />

<div class="example">
    <div class="example-banner" style="background: url('<%= linkPath %>/images/example/banner.jpg') top center no-repeat;background-size: cover;">
    </div>
    <div  class="container news">
        <div id="newsBox" class="row">
        </div>
        <!--<div class="row">-->
        <!--<div class="col-xs-4 example-item">-->
        <!--<img src="<%= linkPath %>/images/example/example1.jpg" alt="">-->
        <!--<div class="example-title">-->
        <!--<span class="title-l">案例一</span><span class="title-r">2018</span>-->
        <!--</div>-->
        <!--<h3>卵巢功能衰退 国内四次失败 泰国试管一次圆梦</h3>-->
        <!--<p class="example-content">李女士和老公在别人的眼里就是成功人士，人生赢家，但李女士自知心里苦， 曾经为了工作耽误了要孩子的最佳时期，等到想要备孕的时候却发现为时已晚，-->
        <!--李女士来和求必孕医学顾问沟通时一度非常沮丧，她说如果时间可以倒退， 我一定会在最合适的时间，多生几个宝宝，现在会经常劝身边的年轻人，一定要趁年轻要孩子。</p>-->
        <!--<div class="arrBox">-->
        <!--<a href="">&rarr;</a>-->
        <!--</div>-->
        <!--</div>-->
        <!--</div>-->
    </div>
</div>
<script>
    $(function(){

        var ps = 9;
        var cp = 1;

        var getAllNewsStr = function (list) {
            var str = '';
            list.forEach(function (v) {
                str += getNewsStr(v);
            })
            return str;
        }

        var getNewsStr = function (item) {
            return '<a href="'+ item.linkedUrl +'" target="_blank">' +
                '<div class="col-sm-6 col-xs-12 newsBox">\n' +
                '<div class="new-item" style="display: inline-block;width:100%;height: 100%;padding:10px;cursor: pointer;">' +
                '            <div class="col-xs-7 newsText">\n' +
                '                <div class="col-xs-12 date"><span class="month">'+ item.releaseDate +'</span>&nbsp;&nbsp;&nbsp;&nbsp;'+ item.releaseYear +'</div>\n' +
                '                <div class="col-xs-12"><h3>'+ item.newsTitle +'</h3></div>\n' +
                '                <div class="col-xs-12"><p class="mainText">'+ item.newsDetailed +'</p></div>\n' +
                '                <div class="col-xs-12 arrBox"> &rarr;</div>\n' +
                '            </div>\n' +
                '            <div class="col-xs-5 newsPic">\n' +
                '                <img style="width: 100%" src="'+ item.imgUrl +'" alt="">\n' +
                // '                <img style="width: 100%" src="<%= linkPath %>/images/news1.jpg" alt="">\n' +
                '            </div>\n' +
                '</div>\n'+
                '        </div>'
            '</a>'
        }
        $.post(goBaseUrl + '/songbao/v1/news',JSON.stringify({pageSize:ps,currentPage:cp}),function (data) {
            var data = data.Data;
            var list = data.newsList ;
            $("#newsBox").html(getAllNewsStr(list));
        },'json')

    })
</script>
